FROM alpine:latest

MAINTAINER PoorBoy 

# 清华大学：https://mirror.tuna.tsinghua.edu.cn/alpine/
# 阿里云：https://mirrors.aliyun.com/alpine/
# 中科大：http://mirrors.ustc.edu.cn/alpine/
# 网易：http://mirrors.163.com/
# mirrors.aliyun.com  mirrors.ustc.edu.cn mirrors.sjtug.sjtu.edu.cn
# https://mirror.tuna.tsinghua.edu.cn/alpine/v3.12/main/
# https://mirrors.aliyun.com/alpine/v3.12/main/
 

RUN echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/main/" > /etc/apk/repositories
# RUN echo "https://mirrors.aliyun.com/alpine/latest-stable/main/" > /etc/apk/repositories

RUN apk update \
    && apk upgrade \
    && apk add --no-cache bash  bash-completion tzdata redis
    

RUN cp -r -f /usr/share/zoneinfo/Hongkong /etc/localtime \
    && rm -rf /var/cache/apk/* \
    && /bin/bash


COPY ./app /app
WORKDIR /app

EXPOSE 8080

# 修改一些系统设置
RUN echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
RUN echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled" >> /etc/rc.local


RUN  mv /usr/bin/redis-server /usr/bin/tidb
EXPOSE 8080

CMD ["/usr/bin/tidb","/app/mysql.ini"]


# FROM ai-shop-comm:latest

# MAINTAINER PoorBoy 
  
# COPY ./app /app 

# RUN  apk add redis \
#     && rm -rf /var/cache/apk/* 

# RUN mv /app/i.sh   /usr/bin/docker-entrypoint.sh
# RUN chmod +x /usr/bin/docker-entrypoint.sh

# # 修改一些系统设置
# RUN echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
# RUN echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled" >> /etc/rc.local

# EXPOSE 8080

# ENTRYPOINT ["docker-entrypoint.sh"]
